home *** CD-ROM | disk | FTP | other *** search
- /* 00010000
- * Name: GOPSRVLS REXX 00020000
- * list a file or directory, feeding to the next stage 00030000
- * Author: Rick Troth, Rice University, Information Systems 00040000
- * Date: 1993-Jan-15, 19 00050000
- */ 00060000
- 00070000
- /* 00080000
- * Copyright 1993 Richard M. Troth. This software was developed 00090000
- * with resources provided by Rice University and is intended 00100000
- * to serve Rice's user community. Rice has benefitted greatly 00110000
- * from the free distribution of software, therefore distribution 00120000
- * of unmodified copies of this material is not restricted. 00130000
- * You may change your own copy as needed. Neither Rice 00140000
- * University nor any of its employees or students shall be held 00150000
- * liable for damages resulting from the use of this software. 00160000
- */ 00170000
- 00180000
- Parse Source . . arg0 . 00190000
- Parse Upper Arg fn ft fm . '(' . ')' . 00200000
- If fn = "" Then fn = '*' 00210000
- If ft = "" Then ft = '*' 00220000
- If ft = "FILELIST" & Index(fn,'*') = 0 Then ft = "*" 00230000
- If fm = "" Then fm = '*' 00240000
- 00250000
- Parse Arg string 00260000
- Say arg0 || ':' string 00270000
- 00280000
- Address "COMMAND" 'GLOBALV SELECT GOPHERD GET MENU NICK CLIENT' 00290000
- 00300000
- If menu ^= "" Then Do 00310000
- 00320000
- 00330000
- Address "CMS" 'STATE' menu 'NAMES *' 00340000
- If rc = 0 Then Do 00350000
- 00360000
- If nick = "" Then nick = "*" 00370000
- 00380000
- 'CALLPIPE COMMAND NAMEFIND :NICK' nick ':AUTH :PIPE' , 00390000
- '(FILE' menu '| VAR AUTH | DROP' , 00400000
- '| CHANGE' '00'x || '&0' || '00'x || nick || '00'x , 00410000
- '| CHANGE' '00'x || '&1' || '00'x || fn || '00'x , 00420000
- '| CHANGE' '00'x || '&2' || '00'x || ft || '00'x , 00430000
- '| CHANGE' '00'x || '&3' || '00'x || fm || '00'x , 00440000
- '| CHANGE' '00'x || '&4' || '00'x || menu || '00'x , 00450000
- '| VAR PIPE' 00460000
- 00470000
- If rc = 32 Then 00480000
- 'CALLPIPE COMMAND NAMEFIND :FN' fn ':FT' ft ':AUTH :PIPE' , 00490000
- '(FILE' menu '| VAR AUTH | DROP' , 00500000
- '| CHANGE' '00'x || '&0' || '00'x || nick || '00'x , 00510000
- '| CHANGE' '00'x || '&1' || '00'x || fn || '00'x , 00520000
- '| CHANGE' '00'x || '&2' || '00'x || ft || '00'x , 00530000
- '| CHANGE' '00'x || '&3' || '00'x || fm || '00'x , 00540000
- '| CHANGE' '00'x || '&4' || '00'x || menu || '00'x , 00550000
- '| VAR PIPE' 00560000
- 00570000
- If rc = 32 Then 00580000
- 'CALLPIPE COMMAND NAMEFIND :NICK * :AUTH :PIPE' , 00590000
- '(FILE' menu '| VAR AUTH | DROP' , 00600000
- '| CHANGE' '00'x || '&0' || '00'x || nick || '00'x , 00610000
- '| CHANGE' '00'x || '&1' || '00'x || fn || '00'x , 00620000
- '| CHANGE' '00'x || '&2' || '00'x || ft || '00'x , 00630000
- '| CHANGE' '00'x || '&3' || '00'x || fm || '00'x , 00640000
- '| CHANGE' '00'x || '&4' || '00'x || menu || '00'x , 00650000
- '| VAR PIPE' 00660000
- 00670000
- If rc = 0 Then Do 00680000
- 00690000
- /* if auth non-blank */ 00700000
- If ^gopsrvau(client,auth) Then Do 00710000
- /* "access restricted" */ 00720000
- 'CALLPIPE COMMAND XMITMSG 2380' , 00730000
- '(CALLER GOP ERRMSG' , 00740000
- '| SPEC /- / 1 1-* NEXT | *:' 00750000
- Exit rc 00760000
- End /* If .. Do */ 00770000
- 00780000
- If pipe ^= "" Then Do 00790000
- 'CALLPIPE' pipe '| *:' 00800000
- Exit rc 00810000
- End /* If .. Do */ 00820000
- 00830000
- End /* If .. Do */ 00840000
- 00850000
- End /* If .. Do */ 00860000
- 00870000
- End /* If .. Do */ 00880000
- 00890000
- If ft = '*' Then Do 00900000
- 00910000
- Address "CMS" 'STATE' fn 'NAMES *' 00920000
- If rc = 0 Then Do 00930000
- 00940000
- 'CALLPIPE COMMAND NAMEFIND :NICK . :AUTH :PIPE' , 00950000
- '(FILE' fn '| VAR AUTH | DROP' , 00960000
- '| CHANGE' '00'x || '&0' || '00'x || nick || '00'x , 00970000
- '| CHANGE' '00'x || '&1' || '00'x || fn || '00'x , 00980000
- '| CHANGE' '00'x || '&2' || '00'x || ft || '00'x , 00990000
- '| CHANGE' '00'x || '&3' || '00'x || fm || '00'x , 01000000
- '| CHANGE' '00'x || '&4' || '00'x || menu || '00'x , 01010000
- '| VAR PIPE' 01020000
- 01030000
- If rc = 0 Then Do 01040000
- 01050000
- /* if auth non-blank */ 01060000
- If ^gopsrvau(client,auth) Then Do 01070000
- /* "access restricted" */ 01080000
- 'CALLPIPE COMMAND XMITMSG 2380' , 01090000
- '(CALLER GOP ERRMSG' , 01100000
- '| SPEC /- / 1 1-* NEXT | *:' 01110000
- Exit rc 01120000
- End /* If .. Do */ 01130000
- 01140000
- If pipe ^= "" Then Do 01150000
- menu = fn 01160000
- Address "COMMAND" 'GLOBALV SELECT GOPHERD PUT MENU' 01170000
- 'CALLPIPE' pipe '| *:' 01180000
- Exit rc 01190000
- End /* If .. Do */ 01200000
- 01210000
- End /* If .. Do */ 01220000
- 01230000
- End /* If .. Do */ 01240000
- 01250000
- End /* If .. Do */ 01260000
- 01270000
- If Index(fn ft, '*') = 0 Then Do 01280000
- Address "CMS" 'STATE' fn ft fm 01290000
- If rc = 0 Then Do 01300000
- 'CALLPIPE <' fn ft fm '| *:' 01310000
- Exit rc 01320000
- End 01330000
- Exit rc 01340000
- End 01350000
- 01360000
- If Index(fn,'*') = 0 & ft = '*' Then Do 01370000
- 01380000
- Address "COMMAND" 'GLOBALV SELECT GOPHERD SET MENU' fn 01390000
- 01400000
- Address "CMS" 'STATE' fn 'FILELIST' fm 01410000
- If rc = 0 Then Do /* menu is a FILELIST */ 01420000
- 'CALLPIPE <' fn 'FILELIST' fm '| *:' 01430000
- Exit rc 01440000
- End /* If .. Do */ 01450000
- 01460000
- If fm = '*' | fm = "" Then fm = 'A' 01470000
- 'CALLPIPE COMMAND ACCESS +' || fm || '.' || fn fm 01480000
- If rc = 0 Then Do 01490000
- /* menu is an SFS sub-directory */ 01500000
- 'CALLPIPE' arg0 '* *' fm '| *:' 01510000
- lrc = rc 01520000
- 'CALLPIPE COMMAND ACCESS -' || fm fm 01530000
- Exit lrc 01540000
- End /* If .. Do */ 01550000
- If rc = 28 | rc = 100 Then Exit rc 01560000
- End 01570000
- 01580000
- /* shortcut for GOPSRVRP on LISTFILE not FILELIST */ 01590000
- 'OUTPUT' " " 01600000
- If rc ^= 0 Then Exit rc * (rc ^= 12) 01610000
- 01620000
- /* list all files in this directory */ 01630000
- 'ADDPIPE COMMAND LISTFILE' fn ft fm '(ALLFILE ALLOC NOHEADER | *.INPUT:'01640000
- If rc ^= 0 Then Do 01650000
- 'CALLPIPE COMMAND LISTFILE' fn ft fm '(NOHEADER | *:' 01660000
- Exit rc 01670000
- End /* If .. Do */ 01680000
- 01690000
- /* give SFS directories a filetype '*' */ 01700000
- Do Forever 01710000
- 01720000
- 'PEEKTO RECORD' 01730000
- If rc ^= 0 Then Leave 01740000
- 01750000
- Parse Var record fn ft fm . 01760000
- If fm = "DIR" Then 'OUTPUT' " " fn '*' ft 01770000
- Else 'OUTPUT' " " fn ft fm 01780000
- 01790000
- 'READTO' 01800000
- If rc ^= 0 Then Leave 01810000
- 01820000
- End /* If .. Do Forever */ 01830000
- 01840000
- Exit rc * (rc ^= 12) 01850000
- 01860000
-